package cn.itcast.spring.demo3;

import static org.junit.Assert.*;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserServiceTest {

	@Test
	public void getUserService() throws Exception {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		UserServiceImpl bean = (UserServiceImpl) context.getBean("userServiceImpl");
		bean.eat();
		//调用close方法来关闭我们的容器，就会调用我们的销毁方法
		context.close();
		
		
	}
	
	

}
